From: Florian Müllner Date: Wed, 17 May 2017 21:57:18 +0000 (+0200) Subject: extensionSystem: Catch import errors X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~224 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d461d02cdcc007138f9d39dc7ca7cd62a38e3607;p=gnome-shell.git extensionSystem: Catch import errors While we catch errors that occur when calling init(), enable() or disable(), the import itself can throw an exception, for instance if the extension imports an unavailable typelib or tries to draw in a conflicting library. https://bugzilla.gnome.org/show_bug.cgi?id=781728 --- diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index fc359e6ac..f25d63ae8 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -225,7 +225,12 @@ function initExtension(uuid) { let extensionState = null; ExtensionUtils.installImporter(extension); - extensionModule = extension.imports.extension; + try { + extensionModule = extension.imports.extension; + } catch(e) { + logExtensionError(uuid, e); + return false; + } if (extensionModule.init) { try {